import axios, {ResponseData} from 'yuxin-base/src/utils/axios'

export function getHouseRoom(id: object): Promise<ResponseData> {
	return axios.request({
		url: `/house/house_room/get/${id}`,
		method: 'GET'
	})
}
export function getRenterInfo(houseId: string): Promise<ResponseData> {
	return axios.request({
		url: `/contract/renter_contract/renter_info/${houseId}`,
		method: 'GET'
	})
}
export function getDecisionList(data: object): Promise<ResponseData> {
	return axios.request({
		url: '/system/decision/list',
		data,
		method: 'POST'
	})
}

/**
 * 获取房源下房间列表
 * @param id
 */
export function getHouseRooms(id: string): Promise<ResponseData> {
	return axios.request({
		url: `/basesearch/house/house_rooms/${id}`,
		method: 'GET'
	})
}

export function getAssociatedDevice(roomId: string): Promise<ResponseData> {
	return axios.request({
		url: `/house/house_room/get_associated_device/${roomId}`,
		method: 'POST'
	})
}

/**
 * 获取子间 设备
 * @param data
 */
export function getDeviceList(data: object): Promise<ResponseData> {
	return axios.request({
		url: '/device/device/list',
		data,
		method: 'POST'
	})
}
